<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.org/rich"
	template="../include/template.xhtml">
	
	<ui:define name="pageTitle">
		<h:outputText value="个人作品库" />
	</ui:define>
	<ui:define name="logoTitle">
		<h:outputText value="作品" />
	</ui:define>	
	<ui:define name="content">
		<br />
		<h:outputText value="个人作品库" class="strong"></h:outputText>
		<rich:separator lineType="double" height="2px" />

		<rich:panel>

			<rich:spacer width="30px"></rich:spacer>
			<s:div styleClass="right_center">
				<s:link value="作品库" view="/opus/index.xhtml" />
				<h:outputText value=" --> 作品添加" />
			</s:div>

			<s:div styleClass="right_center">
				<a:form>
					<h:panelGrid columns="2" width="100%">
						<h:outputText value="作品名称:" />
						<h:inputText value="#{opus.topic}" class="inputAffectu" />
						<h:outputText value="标签:" />
						<s:div>
							<h:inputText value="#{opus.tags}" class="inputAffectu" />
							<rich:spacer width="10px;" />
							<h:outputText value="不妨以逗号,隔开" />
						</s:div>
						<h:outputText value="所属类别:" />
						<s:div>
							<a:region>
								<h:selectOneMenu value="#{opusIndexAction.categoryId}"
									class="inputAffectu">
									<a:support event="onchange" reRender="subCategory" />
									<f:selectItem itemValue="-1" itemLabel="请选择" />
									<f:selectItems value="#{opusIndexAction.firstCategoryItems}" />
								</h:selectOneMenu>
								<h:selectOneMenu id="subCategory"
									value="#{opusIndexAction.subCategoryId}" class="inputAffectu">
									<f:selectItems value="#{opusIndexAction.subCategoryItems}" />
								</h:selectOneMenu>
								<a:status>
									<f:facet name="start">
										<h:graphicImage
											style="width:20px;height:20px;margin-bottom:-6px"
											value="/images/small_loading.gif" />
									</f:facet>
								</a:status>
							</a:region>
						</s:div>
						<h:outputText value="描述:" />
						<h:inputTextarea value="#{opus.description}" rows="3"
							class="inputAffectu" />
						<h:outputText value="作品:" />
						<rich:fileUpload addControlLabel="添加"
							fileUploadListener="#{opusIndexAction.uploadListener}"
							maxFilesQuantity="1" reRender="table" id="upload"
							immediateUpload="true" acceptedTypes="jpg, gif, png, bmp"
							listWidth="100%" styleClass="inputAffectu">
						</rich:fileUpload>
					</h:panelGrid>
					<a:commandButton value="提交"
						action="#{opusIndexAction.saveOpus(opus)}"></a:commandButton>
				</a:form>
			</s:div>
		</rich:panel>
	</ui:define>
</ui:composition>
